package com.guaju.yueshangLife.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class MeOrder {


    /**
     * code : 200
     * msg : ok
     * data : [{"id":4,"order_number":"20191019165636871242","total_account":"3.00","total_amount":3,"payment_method":0,"paid_at":"2019-10-19 16:57:16","refund_status":"pending","refund_no":"","closed":0,"reviewed":0,"ship_status":"received","created_at":"2019-10-19 16:56:36","items":[{"id":4,"product_id":1,"amount":1,"price":"1.00","detail":{"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"},"attribute":["橙色","XL"]}},{"id":5,"product_id":1,"amount":1,"price":"1.00","detail":{"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/bg-07.jpg"},"attribute":["橙色","L"]}}]}]
     */

    private int code;
    private String msg;
    private List<DataBean> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * id : 4
         * order_number : 20191019165636871242
         * total_account : 3.00
         * total_amount : 3
         * payment_method : 0
         * paid_at : 2019-10-19 16:57:16
         * refund_status : pending
         * refund_no :
         * closed : 0
         * reviewed : 0
         * ship_status : received
         * created_at : 2019-10-19 16:56:36
         * items : [{"id":4,"product_id":1,"amount":1,"price":"1.00","detail":{"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"},"attribute":["橙色","XL"]}},{"id":5,"product_id":1,"amount":1,"price":"1.00","detail":{"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/bg-07.jpg"},"attribute":["橙色","L"]}}]
         */

        private int id;
        private String order_number;
        private String total_account;
        private int total_amount;
        private int payment_method;
        private int  status;
        private String paid_at;
        private String refund_status;
        private String refund_no;

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        private int closed;
        private int reviewed;
        private String ship_status;
        private String created_at;
        private List<ItemsBean> items;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getOrder_number() {
            return order_number;
        }

        public void setOrder_number(String order_number) {
            this.order_number = order_number;
        }

        public String getTotal_account() {
            return total_account;
        }

        public void setTotal_account(String total_account) {
            this.total_account = total_account;
        }

        public int getTotal_amount() {
            return total_amount;
        }

        public void setTotal_amount(int total_amount) {
            this.total_amount = total_amount;
        }

        public int getPayment_method() {
            return payment_method;
        }

        public void setPayment_method(int payment_method) {
            this.payment_method = payment_method;
        }

        public String getPaid_at() {
            return paid_at;
        }

        public void setPaid_at(String paid_at) {
            this.paid_at = paid_at;
        }

        public String getRefund_status() {
            return refund_status;
        }

        public void setRefund_status(String refund_status) {
            this.refund_status = refund_status;
        }

        public String getRefund_no() {
            return refund_no;
        }

        public void setRefund_no(String refund_no) {
            this.refund_no = refund_no;
        }

        public int getClosed() {
            return closed;
        }

        public void setClosed(int closed) {
            this.closed = closed;
        }

        public int getReviewed() {
            return reviewed;
        }

        public void setReviewed(int reviewed) {
            this.reviewed = reviewed;
        }

        public String getShip_status() {
            return ship_status;
        }

        public void setShip_status(String ship_status) {
            this.ship_status = ship_status;
        }

        public String getCreated_at() {
            return created_at;
        }

        public void setCreated_at(String created_at) {
            this.created_at = created_at;
        }

        public List<ItemsBean> getItems() {
            return items;
        }

        public void setItems(List<ItemsBean> items) {
            this.items = items;
        }

        public static class ItemsBean implements Parcelable {
            /**
             * id : 4
             * product_id : 1
             * amount : 1
             * price : 1.00
             * detail : {"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"},"attribute":["橙色","XL"]}
             */

            private int id;
            private int product_id;
            private int amount;
            private String price;
            private DetailBean detail;

            protected ItemsBean(Parcel in) {
                id = in.readInt();
                product_id = in.readInt();
                amount = in.readInt();
                price = in.readString();
            }

            public static final Creator<ItemsBean> CREATOR = new Creator<ItemsBean>() {
                @Override
                public ItemsBean createFromParcel(Parcel in) {
                    return new ItemsBean(in);
                }

                @Override
                public ItemsBean[] newArray(int size) {
                    return new ItemsBean[size];
                }
            };

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public int getProduct_id() {
                return product_id;
            }

            public void setProduct_id(int product_id) {
                this.product_id = product_id;
            }

            public int getAmount() {
                return amount;
            }

            public void setAmount(int amount) {
                this.amount = amount;
            }

            public String getPrice() {
                return price;
            }

            public void setPrice(String price) {
                this.price = price;
            }

            public DetailBean getDetail() {
                return detail;
            }

            public void setDetail(DetailBean detail) {
                this.detail = detail;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(id);
                dest.writeInt(product_id);
                dest.writeInt(amount);
                dest.writeString(price);
            }

            public static class DetailBean implements Parcelable{
                /**
                 * name : Ace连帽卫衣
                 * cover : {"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"}
                 * attribute : ["橙色","XL"]
                 */

                private String name;
                private CoverBean cover;
                private List<String> attribute;

                protected DetailBean(Parcel in) {
                    name = in.readString();
                    attribute = in.createStringArrayList();
                }

                public static final Creator<DetailBean> CREATOR = new Creator<DetailBean>() {
                    @Override
                    public DetailBean createFromParcel(Parcel in) {
                        return new DetailBean(in);
                    }

                    @Override
                    public DetailBean[] newArray(int size) {
                        return new DetailBean[size];
                    }
                };

                public String getName() {
                    return name;
                }

                public void setName(String name) {
                    this.name = name;
                }

                public CoverBean getCover() {
                    return cover;
                }

                public void setCover(CoverBean cover) {
                    this.cover = cover;
                }

                public List<String> getAttribute() {
                    return attribute;
                }

                public void setAttribute(List<String> attribute) {
                    this.attribute = attribute;
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeString(name);
                    dest.writeStringList(attribute);
                }

                public static class CoverBean {
                    /**
                     * host : https://static.nfangxu.com/
                     * path : images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg
                     */

                    private String host;
                    private String path;

                    public String getHost() {
                        return host;
                    }

                    public void setHost(String host) {
                        this.host = host;
                    }

                    public String getPath() {
                        return path;
                    }

                    public void setPath(String path) {
                        this.path = path;
                    }
                }
            }
        }
    }
}
